/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "promotionaloffer")
@XmlRootElement(name = "promotionaloffer")
@NamedQueries({
    @NamedQuery(name = "Promotionaloffer.findAll", query = "SELECT p FROM Promotionaloffer p"),
    @NamedQuery(name = "Promotionaloffer.findByPromotionalofferID", query = "SELECT p FROM Promotionaloffer p WHERE p.promotionalofferID = :promotionalofferID"),
    @NamedQuery(name = "Promotionaloffer.findByPromotionaloffername", query = "SELECT p FROM Promotionaloffer p WHERE p.promotionaloffername = :promotionaloffername"),
    @NamedQuery(name = "Promotionaloffer.findByDescription", query = "SELECT p FROM Promotionaloffer p WHERE p.description = :description"),
    @NamedQuery(name = "Promotionaloffer.findByIsdeleted", query = "SELECT p FROM Promotionaloffer p WHERE p.isdeleted = :isdeleted")})
public class Promotionaloffer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "PromotionalofferID")
    private Long promotionalofferID;
    @Column(name = "promotionaloffername")
    private String promotionaloffername;
    @Column(name = "description")
    private String description;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "promotionaloffertype_PromotionaloffertypeID", referencedColumnName = "PromotionaloffertypeID")
    @ManyToOne(optional = false)
    private Promotionaloffertype promotionaloffertype;
    @JoinColumn(name = "discountype_DiscounttypeID", referencedColumnName = "DiscounttypeID")
    @ManyToOne(optional = false)
    private Discountype discountype;

    public Promotionaloffer() {
    }

    public Promotionaloffer(Long promotionalofferID) {
        this.promotionalofferID = promotionalofferID;
    }

    public Long getPromotionalofferID() {
        return promotionalofferID;
    }

    public void setPromotionalofferID(Long promotionalofferID) {
        this.promotionalofferID = promotionalofferID;
    }

    public String getPromotionaloffername() {
        return promotionaloffername;
    }

    public void setPromotionaloffername(String promotionaloffername) {
        this.promotionaloffername = promotionaloffername;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Promotionaloffertype getPromotionaloffertype() {
        return promotionaloffertype;
    }

    public void setPromotionaloffertype(Promotionaloffertype promotionaloffertype) {
        this.promotionaloffertype = promotionaloffertype;
    }

    public Discountype getDiscountype() {
        return discountype;
    }

    public void setDiscountype(Discountype discountype) {
        this.discountype = discountype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (promotionalofferID != null ? promotionalofferID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Promotionaloffer)) {
            return false;
        }
        Promotionaloffer other = (Promotionaloffer) object;
        if ((this.promotionalofferID == null && other.promotionalofferID != null) || (this.promotionalofferID != null && !this.promotionalofferID.equals(other.promotionalofferID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Promotionaloffer[promotionalofferID=" + promotionalofferID + "]";
    }

}
